Repository navigation
test(frontend): give each failure-text test its types, also with CI=true - #546
Merged
Merged
Conversation
With CI=true, typescript-eslint infers a single run. It takes each lint of a path after the first for a --fix pass and gives it an isolated program with no types. Each test lints the same path, so the type-aware cases of messages/failure-text found nothing in CI. The test's ESLint turns off the inference. Amp-Thread-ID: https://ampcode.com/threads/T-01a2045d-65f9-767c-a723-e94e1f37f5d4 Co-authored-by: Amp <amp@ampcode.com>
Owner
Author
|
review-gate: passed e47317c Independent review found no high or medium findings. One low finding: the code comment named the wrong cause (single run types the file on disk). The real cause is single run's per-path parse count, which gives each lint after the first an isolated program with no types. Fixed in 5a17c87 (comment and commit message). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The
api-contractandwithout-examplesjobs fail onmainsince #543. Sixmessages/failure-textcases infrontend/eslint.config.test.jsget no report in CI, and pass locally.What changed
failureTextMessagesin the test setsdisallowAutomaticSingleRunInference: trueon its ownESLint.With
CI=true, typescript-eslint infers a single run. In that mode it counts the parses of each path, and takes each parse after the first for a--fixpass, so it gives the file an isolated program with no imports and no default lib. Every test lints the same path,src/components/query-error.tsx, so each test after the first got no types, andisErrorandisProblemTextfound nothing. The first case, which needs no types, passed.Blast Radius
Test only.
eslint.config.jsis unchanged, andpnpm lintin CI parses each file once, so the rule keeps its types there.Verification
CI=true pnpm vitest run eslint.config.test.js.CI=trueand without it, andCI=true pnpm testpasses 910 of 910.pnpm lintis clean.